package com.aerotechnic.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.aerotechnic.models.User;

@Repository("UserDao")
public class UserDao extends BaseDao<User> {
	public User authenticate(String login, String password) {
		List list = getHibernateTemplate().find(
				"from User where login='" + login + "' and password ='"
						+ password + "\'");
		if(list.size()==0){
			return null;
		}
		return (User) list.get(0);
	}

}
